package com.zsl.swing.redis.desktop.model;

import com.zsl.swing.redis.desktop.type.NodeTypeEnum;

import java.util.Objects;

/**
 * 
 * @author 张帅令
 * @description DB key对应的节点实体
 *
 */
public class KeyEntity{
	

	private String showName;
	
	private String nextCursor;

	private int scanCount;

	private String keyword;
	
	private NodeTypeEnum nodeType;

	private String key;

	private String value;

	private String type;

	public int getScanCount() {
		return scanCount;
	}

	public void setScanCount(int scanCount) {
		this.scanCount = scanCount;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isRoot(){
		return this.nodeType == NodeTypeEnum.DB_KEY_ROOT;
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public NodeTypeEnum getNodeType() {
		return nodeType;
	}

	public void setNodeType(NodeTypeEnum nodeType) {
		this.nodeType = nodeType;
	}

	public String getShowName() {
		return showName;
	}

	public void setShowName(String value) {
		this.showName = value;
	}

	public String getNextCursor() {
		return nextCursor;
	}

	public void setNextCursor(String nextCursor) {
		this.nextCursor = nextCursor;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		KeyEntity keyEntity = (KeyEntity) o;
		return Objects.equals(showName, keyEntity.showName);
	}

	@Override
	public int hashCode() {
		return Objects.hash(showName);
	}
}
